//
//  PlaceholderView.m
//  兼职页面
//
//  Created by kuiyuan liang on 2021/5/27.
//

#import "PlaceholderView.h"
#import "CommonUtil.h"

@interface PlaceholderView()

@property (strong, nonatomic) UILabel * nameLabel;
@property (strong, nonatomic) UIImageView * bgImageView;
@end

@implementation PlaceholderView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = RGB(243.0, 243.0, 243.0);
        [self addSubview:self.nameLabel];
        [self addSubview:self.bgImageView];
    }
    return self;
}


-(UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, AD(100), SCREEN_WIDTH, AD(30))];
        _nameLabel.font = [UIFont boldSystemFontOfSize:AD(18)];
        _nameLabel.textColor = [UIColor blackColor];
        _nameLabel.text = @"暂无数据";
        _nameLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _nameLabel;
}

-(UIImageView *)bgImageView{
    if (!_bgImageView) {
        _bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-AD(100))/2, AD(150), AD(100), AD(100))];
        _bgImageView.image = [UIImage imageNamed:@"暂无数据"];
    }
    return _bgImageView;
}

@end
